/*
* acooly.cn Inc.
* Copyright (c) 2017 All Rights Reserved.
* create by ouwen
* date:2017-09-20
*/
package com.yiji.fintech.musfinance.web;

import com.acooly.core.common.web.AbstractJQueryEntityController;
import com.yiji.fintech.musfinance.base.enums.CurrencyEnum;
import com.yiji.fintech.musfinance.common.enums.*;
import com.yiji.fintech.musfinance.entity.BfjBankAccount;
import com.yiji.fintech.musfinance.service.BfjBankAccountService;
import com.yiji.fintech.musfinance.service.CooperationInstBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * center_bfj_bank_account 管理控制器
 * 
 * @author ouwen
 * Date: 2017-09-20 10:59:50
 */
@Controller
@RequestMapping(value = "/manage/bfjbankaccount/bfjBankAccount")
public class BfjBankAccountManagerController extends AbstractJQueryEntityController<BfjBankAccount, BfjBankAccountService> {
	

	{
		allowMapping = "*";
	}
	@Autowired
	private CooperationInstBankService cooperationInstBankService;
	@SuppressWarnings("unused")
	@Autowired
	private BfjBankAccountService bfjBankAccountService;

	@Override
	public String edit(HttpServletRequest request, HttpServletResponse response, Model model) {
		String channelId = request.getParameter("channelId");
		model.addAttribute("channelId",channelId);
		return super.edit(request, response, model);
	}
	@Override
	public String create(HttpServletRequest request, HttpServletResponse response, Model model) {
		String channelId = request.getParameter("channelId");
		model.addAttribute("channelId",channelId);
		return super.create(request, response, model);
	}

	@Override
	protected void referenceData(HttpServletRequest request, Map<String, Object> model) {
		model.put("allAccountStatuss", AccountStatusEnum.mapping());
		model.put("allBankAccountTypes", BankAccountTypeEnum.mapping());
		model.put("allFundTypes", FundTypeEnum.mapping());
		model.put("allSavingTypes", SavingTypeEnum.mapping());
		model.put("allInfoQueryTypes", InfoQueryTypeEnum.mapping());
		model.put("allCurrencys", CurrencyEnum.mapping());
		List<Map<String,Object>> allCoBank = cooperationInstBankService.getAllCoBank();
		model.put("allCoBank", allCoBank);
	}

}
